From: Florian Müllner Date: Tue, 29 Jan 2019 21:43:41 +0000 (+0100) Subject: appFavorites: Fix nonsense condition X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2^2~93 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c353914dd081c243d8d9a2b0670a35ed19c94cce;p=gnome-shell.git appFavorites: Fix nonsense condition The "in" operator has a lower precedence than negation, so we are actually testing whether the favorites map contains "false". Add parentheses to get the intended behavior. Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375 --- diff --git a/js/ui/appFavorites.js b/js/ui/appFavorites.js index 0bdf41b22..cc3e3c32a 100644 --- a/js/ui/appFavorites.js +++ b/js/ui/appFavorites.js @@ -153,7 +153,7 @@ class AppFavorites { } _removeFavorite(appId) { - if (!appId in this._favorites) + if (!(appId in this._favorites)) return false; let ids = this._getIds().filter(id => id != appId);